<?php
$sign = array('【奇葩】','【打下】','【发的】','【签名】','【随机】','【熊猫】');
$api = array('santong','chuanglan');
$channel = array('0','1','2');
for($i=0;$i<=9000000;$i++) {
    $data                 = array(
        'time'     => time(),
        'msg_type' => 'mobile',
        'data'     => array(
            [
                'to'      => '15997457695,15997457695,15997457695,15997457695,15997457695,15997457695,15997457695,15997457695,15997457695,15997457695',
                'template'=> 1 ,
                'var_content' => [
                    'j54658784654','10052.32','http://www.bbb.coom'
                ],
            ],
            [
                'to'      => '15997457695,',
                'template'=> 2 ,
                'var_content' => [
                    'L54564546546',545456.66
                ],
            ],
            [
                'to'      => '15997457695,15997457695,15997457695,15997457695,15997457695,15997457695',
                'template'=> 3 ,
            ],
        ),
    );
    $data['timely']       = (string)mt_rand(0, 1);
    $data['content_type'] = mt_rand(0, 1);
    if (mt_rand(0, 1)) {
        $data['sms_service'] = $api[mt_rand(0, 1)];
    }
    $data['content_type'] = $channel[mt_rand(0, 1)];
    if (mt_rand(0, 1)) {
        $data['sign'] = $sign[array_rand($sign)];
    }

    /*$data['timely']       = 1;
    #$data['sign'] = '【玖融网】';
    $data['content_type'] = 'hy';
    $data['sms_service'] = 'chuanglan';*/

    $data = json_encode($data, JSON_UNESCAPED_UNICODE);
    $ch   = curl_init('http://msg2.cn');
    #$ch   = curl_init('http://119.23.162.11:8081');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $time = microtime(true);
    $res = curl_exec($ch);
    if(curl_errno($ch))
    {
        echo curl_error($ch),'  ',microtime(true) ,PHP_EOL;
    }
    else{
        echo $res,'   ',round((microtime(true)-$time)*1000,2).' 毫秒',PHP_EOL ;
    }
}
